using System;
using System.ComponentModel;
using System.Globalization;

namespace TXLooker.WorkItemExtention.UI.QueryManager
{
    public class QueryConverter : TypeConverter
    {
        // Fields
        private const string DEFAULT_FORMAT_STRING = "{0}";

        // Methods
        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
        {
            if (destinationType == typeof(string))
            {
                Query query = value as Query;
                return string.Format("{0}", query.QueryValue);
            }
            return base.ConvertTo(context, culture, value, destinationType);
        }
    }

}